<template>
	<view class="activity-box">
		<view class="activity-item" v-for="item in listData" :key="item.name" @click="onClick(item.name)">
			<image :src="item.url" alt="" />
			<text class="title" v-if="item.title">{{item.title}}</text>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		props: {
			listData: {
				type: Array,
				default: new Array(),
			},
		},
		methods: {
			onClick(name) {
				this.$emit("on-click",name)
			}
		}
	}
</script>

<style lang="less">
	.activity-box {
		min-width: 100%;
			display: flex;
			flex-flow: row nowrap;
			justify-content: space-between;
		.activity-item {
			width: 350rpx;
			height: 200rpx;
			position: relative;
			image {
				width: 100%;
				height: 100%;
			}
			
			.title {
				position: absolute;
				top: 15rpx;
				left: 10rpx;
				color: #ffffffff;
				font-size: 20rpx;
				padding: 5rpx 10rpx;
				border-radius: 13rpx;
				background: linear-gradient(90deg, #FF934C 0%, #FC686F 100%);
			}
		}
	}
</style>